/*
* ============================================================================
*  Name        : filelogger.h
*  Part of     : camengtest
*  Description : 
*  Version     : %version: 2 %
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*
* You are welcome to, but not required to, contribute any modifications that
* improve stability, usability and/or feature set of the library back to
* Symbian/S60 Camera Wrapper project, as long as binary compatibility is
* retained. See https://projects.forum.nokia.com/camerawrapper for more info.
* ============================================================================
*/

#ifndef FILELOGGER_H_
#define FILELOGGER_H_

#ifdef _DEBUG

#include <e32std.h>
#include <flogger.h>  // link against flogger.lib

_LIT( KLogsDir, "CAMENGTEST"); // directory under c:\logs - these macros work only if this directory exists

_LIT( KLogFileName, "ef0cbaad.log");

#define __LOGSTR_TOFILE(S)     {_LIT(KTmpStr, S);RFileLogger::WriteFormat(KLogsDir(), KLogFileName(), EFileLoggingModeAppend, KTmpStr());}
#define __LOGSTR_TOFILE1(S, P) {_LIT(KTmpStr, S);RFileLogger::WriteFormat(KLogsDir(), KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(KTmpStr()),P);}
#define __LOGSTR_TOFILE2(S, P0, P1) {_LIT(KTmpStr, S);RFileLogger::WriteFormat(KLogsDir(), KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(KTmpStr()),P0, P1);}
#define __LOGSTR_TOFILE3(S, P0, P1, P2) {_LIT(KTmpStr, S);RFileLogger::WriteFormat(KLogsDir(), KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(KTmpStr()),P0,P1,P2);}

#else // !_DEBUG (expand to empty strings on release builds)

#define __LOGSTR_TOFILE(S)
#define __LOGSTR_TOFILE1(S, P)
#define __LOGSTR_TOFILE2(S, P0, P1)
#define __LOGSTR_TOFILE3(S, P0, P1, P2)

#endif

#endif /*FILELOGGER_H_*/
